package lanqiao.真题.第06届Java大学B组._01结果填空;

/**
 * @author 挚爱之夕
 * @version 1.0
 * @implSpec
 *
 * @since 2023 - 02 - 20 - 16:44
 */
public class _02五星填数 {
    static int[] nums = {1, 2, 3, 4, 5, 6, 8, 9, 10, 12};
    static int cnt = 0;
    static void dfs(int i){
        if(i == 10){
            int line1 = nums[0] + nums[3] + nums[6] + nums[9];
            int line2 = nums[1] + nums[5] + nums[7] + nums[9];
            int line3 = nums[1] + nums[2] + nums[3] + nums[4];
            int line4 = nums[4] + nums[6] + nums[7] + nums[8];
            int line5 = nums[0] + nums[2] + nums[5] + nums[8];
            if(line1 == line2 && line2 == line3 && line3 == line4 && line4 == line5){
                cnt++;
            }
            return;
        }
        for(int j = i; j < 10; j++){
            swap(i, j);
            dfs(i + 1);
            swap(i, j);
        }
    }
    static void swap(int i, int j){
        if(i != j){
            int t = nums[i];
            nums[i] = nums[j];
            nums[j] = t;
        }
    }
    public static void main(String[] args) {
        cnt = 0;
        dfs(0);
        //一个五角形 对应旋转5种 对应镜像2个
//        System.out.println(cnt);
        //结果要除以10
        System.out.println(cnt / 10);
    }
}
